package com.guotd.ticketSystemPlus.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.guotd.ticketSystemPlus.entity.Airline;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface AirlineMapper extends BaseMapper<Airline> {

     List<Airline> getAirlines();

     List<Airline> getAirlinesByPage(@Param("offset") int offset, @Param("pageSize") int pageSize);
     
     long getTotalCount();

     int addAirline(Airline airline);

     int delAirline(@Param("id") String id);

     int updateAirline(Airline airline);
     
     List<Airline> searchAirlinesByLocations(@Param("fromAirport") String fromAirport, 
                                            @Param("toAirport") String toAirport);
     
     List<Airline> searchAirlinesByLocationsPage(
             @Param("fromAirport") String fromAirport,
             @Param("toAirport") String toAirport,
             @Param("offset") int offset,
             @Param("pageSize") int pageSize);
     
     long getTotalCountByLocations(@Param("fromAirport") String fromAirport, @Param("toAirport") String toAirport);
}
